<script type="text/javascript" charset="utf-8" src="../../../ueditor1_4_3_3/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../ueditor1_4_3_3/ueditor.all.min.js"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="../../../ueditor1_4_3_3/lang/zh-cn/zh-cn.js"></script>

<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">系统值</a>
    <a><cite>升级规则</cite></a>
  </div>
</div>
  
<div class="layui-fluid">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
      <div class="layui-card">
        <!-- <div class="layui-card-header">修改密码</div> -->
        <div class="layui-card-body" pad15>
          
          <div class="layui-form" lay-filter="" >
            <div class="layui-form-item" hidden>
              <label class="layui-form-label">升级规则</label>
              <div class="layui-input-inline" >
                <input type="text" name="spValue" lay-verify="required" lay-verType="tips" class="levelRule layui-input" >
              </div>
            </div>
            <div class="layui-form-item">
              <div class="layui-input-block">
                <button  class="layui-btn" style="float: left;" onclick="getContent()">导入原图文</button>
              </div>
            </div>

              <div class="layui-form-item">
                <label class="layui-form-label">升级规则</label>
                <div class="layui-input-inline">
                  <script id="editor" type="text/plain" style="width:1000px;height:500px;"></script>
                </div>
              </div>
              

            <!-- <div class="layui-form-item">
              <label class="layui-form-label">新密码</label>
              <div class="layui-input-inline">
                <input type="password" name="password" lay-verify="pass" lay-verType="tips" autocomplete="off" id="LAY_password" class="layui-input">
              </div>
              <div class="layui-form-mid layui-word-aux">6到16个字符</div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">确认新密码</label>
              <div class="layui-input-inline">
                <input type="password" name="repassword" lay-verify="repass" lay-verType="tips" autocomplete="off" class="layui-input">
              </div>
            </div> -->
            <div class="layui-form-item">
              <div class="layui-input-block">
                <!-- <button  class="layui-btn" style="float: left;" onclick="saveContent()">保存图文</button> -->
                <button class="layui-btn" lay-submit lay-filter="setmypass">确认修改</button>
              </div>
            </div>
          </div>
          
        </div>
      </div>
    </div>
  </div>
</div>

<script>
layui.use('levelRule', layui.factory('levelRule'));
</script>
<script src="../../../ueditor1_4_3_3/third-party/jquery-1.10.2.js"></script>
<script>
layui.use(['jquery'],function(){
  var $ = layui.jquery
  ,setter = layui.setter;
  var url1 = setter.myurl + 'config';
  
  window.UEDITOR_CONFIG.serverUrl = url1;
  var ue = UE.getEditor('editor');

})

function saveContent() {
  $(".levelRule").val(UE.getEditor('editor').getContent());
  alert("已保存草稿。")
}

function getContent() { 
  UE.getEditor('editor').setContent($(".levelRule").val());
}

layui.use(['admin', 'form', 'upload'], function(){
  var $ = layui.$
  ,form = layui.form
  ,setter = layui.setter
  ,upload = layui.upload;

  
  //上传头像
  upload.render({
    elem: '#layuiadmin-upload-useradmin'
    ,url: setter.myurl + '/admin/uploadMainPicture'
    ,accept: 'images'
    ,method: 'post'
    ,acceptMime: 'image/*'
    ,done: function(res){
      console.log(res)
      $(".mainPiccls").val(res.data);
      $(this.item).prev("div").children("input").val(res.data)
    }
  });
})


</script>